package com.uzhie.exception;

import com.uzhie.web.bean.ErrorBean;

/**
 * 用户操作自定义错误
 * Created by zhangdequan on 2018/7/12.
 */
public class CatalogException extends BussException {
    private int status = -1;
    private String message;

    public CatalogException(String error) {
        this(0, error);
    }

    public CatalogException(int status, String error) {
        super(error);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public ErrorBean getError(){
        ErrorBean error = new ErrorBean();
        error.setCode(status);
        error.setMsg(getMessage());
        return error;
    }

    public class Status {

        public final static String ID_ISNULL = "请选择相关目录操作";
        public final static String CATALOG_ID_ISNULL = "目录id不能为空";
        public final static String CATALOG_NAME_ISNULL = "目录名称不能为空";
        public final static String INSERT_ERROR = "目录添加失败";
        public final static String UPDATA_ERROR = "目录编辑失败";
        public final static String UPDATA_STATUS_ERROR = "更新状态失败";
        public final static String CATALOG_ISNULL = "目录对象不能为空";
        public final static String CATALOG_HAS_BE_USED = "目录已被引用，请确保目录没有被车辆，设备和人员引用才可以进行删除，以及该目录下不存在子目录";
    }
}
